<h2>系统配置</h2>
<form method="post" id="config-form">
    <!-- 数据库配置部分 -->
    <div class="form-section">
        <h3>数据库配置</h3>
        <div class="form-group">
            <label for="db_host">数据库主机:</label>
            <input
                type="text"
                id="db_host"
                name="db_host"
                value="{{DB_HOST}}"
                required
            />
        </div>

        <div class="form-group">
            <label for="db_port">数据库端口:</label>
            <input
                type="text"
                id="db_port"
                name="db_port"
                value="{{DB_PORT}}"
                required
            />
        </div>

        <div class="form-group">
            <label for="db_database">数据库名称:</label>
            <input
                type="text"
                id="db_database"
                name="db_database"
                value="{{DB_DATABASE}}"
                required
            />
        </div>

        <div class="form-group">
            <label for="db_username">数据库用户名:</label>
            <input
                type="text"
                id="db_username"
                name="db_username"
                value="{{DB_USERNAME}}"
                required
            />
        </div>

        <div class="form-group">
            <label for="db_password">数据库密码:</label>
            <input
                type="password"
                id="db_password"
                name="db_password"
                value="{{DB_PASSWORD}}"
            />
        </div>
    </div>

    <!-- Redis配置部分 -->
    <div class="form-section">
        <h3>Redis配置</h3>
        <div class="form-group">
            <label for="redis_host">Redis主机:</label>
            <input
                type="text"
                id="redis_host"
                name="redis_host"
                value="{{REDIS_HOST}}"
                required
            />
        </div>

        <div class="form-group">
            <label for="redis_port">Redis端口:</label>
            <input
                type="text"
                id="redis_port"
                name="redis_port"
                value="{{REDIS_PORT}}"
                required
            />
        </div>

        <div class="form-group">
            <label for="redis_username">Redis用户名 (可选，Redis 6.0+):</label>
            <input
                type="text"
                id="redis_username"
                name="redis_username"
                value="{{REDIS_USERNAME}}"
                placeholder="留空表示未配置用户名认证"
            />
        </div>

        <div class="form-group">
            <label for="redis_password">Redis密码 (可选):</label>
            <input
                type="password"
                id="redis_password"
                name="redis_password"
                value="{{REDIS_PASSWORD}}"
                placeholder="留空表示未配置密码认证"
            />
        </div>
    </div>

    <input type="hidden" name="action" value="config" />
    <div class="form-group">
        <button type="submit" class="btn">测试连接并继续</button>
    </div>
</form>
